package com.smartwebx.ha.dal.realtime.dao;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import com.smartwebx.ha.dal.realtime.dao.handler.ProcessDataEnum;
import com.smartwebx.ha.dal.realtime.sqlprovider.ProcessDataProvider;
import com.smartwebx.ha.dal.usebean.DateValue;
import com.smartwebx.ha.dal.usebean.SplitDateAndTimePointBean;
import com.smartwebx.ha.dal.usebean.SplitDatePointBean;

/**
 * 过程数据获取
 * @author zhangxi
 *
 */
@CacheNamespace(size = 1024)
public interface ProcessDataMapper {

	/**
	 * 水情超警戒天数
	 * 
	 * @param startDate
	 * @param endDate
	 * @param tabName
	 * @param stcd
	 * @param warn
	 *            警戒值
	 * @return
	 */
	@SelectProvider(type = ProcessDataProvider.class, method = "getWaterExceedWarnDaysSQL")
	public Integer getWaterExceedWarnDays(@Param("startDate") Date startDate,
			@Param("endDate") Date endDate,
			@Param("tabName") ProcessDataEnum tabName,
			@Param("stcd") String stcd, @Param("warn") Double warn);
	
	
	/**
	 * 获得开始结束时间(水位、流量)最大、最小、平均值
	 * 
	 * @param startDate
	 * @param endDate
	 * @param tabName
	 * @param stcd
	 * @param dataType
	 *            水位、流量
	 * @return
	 */
	@SelectProvider(type = ProcessDataProvider.class, method = "getProcessListSQL")
	public List<DateValue> getProcessList(
			@Param("splitDatePointBean") SplitDatePointBean splitDatePoint,
			@Param("tabName") ProcessDataEnum tabName,
			@Param("stcd") String stcd,
			@Param("dataType") ProcessDataEnum dataType);

}
